Don't use owner to determine if the auto-bailout should be used#4089
Don't use owner to determine if the auto-bailout should be used#4089sebmarkbage merged 1 commit intofacebook:masterfrom
Conversation
|
@spicyj, This could mean that deeply mutating a static element is actually a common pattern and we might break code by removing this special case. :/ |
|
I knew about this and thought we were planning to take this out after fixing prop mutations internally. |
|
Not having props mutation is no guarantee that this won't break code. So we might as well break it now, maybe? |
|
Right, but it's harder ergonomically to deeply mutate an element that's created within |
|
This change doesn't affect elements created within render. It is easy to mutate objects that live outside of render. Then reuse those deep within an element but those created within render are often recreated. Those created outside of render are as easy to mutate deeply as shallow. Even though they're more likely to be shallow and we might find them earlier because of it, it doesn't change the risk significantly.
|
I didn't realize that we actually special cased this. This is an unfortunate heuristic but it helps minimize the harm that this optimization does.
Don't use owner to determine if the auto-bailout should be used
|
Didn't run travis. #fingerscrossed |
I didn't realize that we actually special cased this. This is an
unfortunate heuristic but it helps minimize the harm that this optimization
does.
Should we try to remove it?
See #4067 (comment)